{% extends 'admin-v2/layout.html.twig' %}

{% set menu = 'admin_v2_user_content_audit_setting' %}
{% do script(['libs/jquery-validation.js','app/js/admin-v2/system/user-content-control/content-audit/index.js']) %}
{% block page_title %}
  {{ parent() }}
  <span data-toggle="popover" data-trigger="hover" data-placement="right" title="" data-html="true"
        data-content="{{ 'admin_v2.system.user_content_control.content_audit_setting.title_tips'|trans }}"
        class="link-medium es-icon es-icon-help text-muted"></span>
{% endblock %}

{% block main %}
  <form class="form-horizontal" id="content_audit_form" method="post" novalidate>
    <div class="form-group">
      <div class="col-md-3 control-label text-right">
        <label for="mode">{{ 'admin_v2.system.user_content_control.content_audit_setting.label'|trans }}</label>
      </div>
      <div class="col-md-8 controls radios">
        <label class="col-md-2">
          <input type="radio" name="mode"
                 value="audit_after" {% if 'audit_after' == contentAuditSetting.mode|default('audit_after') %} checked="checked" {% endif %}>
          {{ 'admin_v2.system.user_content_control.content_audit_setting.audit_after'|trans }}
        </label>
        <span
          class="text-muted text-sm">{{ 'admin_v2.system.user_content_control.content_audit_setting.audit_before.tips'|trans }}</span>
      </div>
{#      <div class="col-md-offset-3 col-md-8 controls radios">#}
{#        <label class="col-md-2">#}
{#          <input type="radio" name="mode"#}
{#                 value="audit_before" {% if 'audit_before' == contentAuditSetting.mode|default('audit_after') %} checked="checked" {% endif %}>#}
{#          {{ 'admin_v2.system.user_content_control.content_audit_setting.audit_before'|trans }}#}
{#        </label>#}
{#        <span#}
{#          class="text-muted text-sm">{{ 'admin_v2.system.user_content_control.content_audit_setting.audit_after.tips'|trans }}</span>#}
{#      </div>#}
    </div>
    <div class="form-group">
      <div class="col-md-3 control-label text-right">
        <label
          for="enable_auto_audit">{{ 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.label'|trans }}</label>
      </div>
      <div class="col-md-8 controls radios">
        <label class="col-md-2">
          <input type="radio" name="enable_auto_audit"
                 value="1" {% if '1' == contentAuditSetting.enable_auto_audit|default(1) %} checked="checked" {% endif %}>
          {{ 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.allow'|trans }}
        </label>
        <span
          class="text-muted text-sm">{{ 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.allow.tips'|trans }}</span>
      </div>
      <div class="col-md-offset-3 col-md-8 controls radios">
        <label class="col-md-2">
          <input type="radio" name="enable_auto_audit"
                 value="0" {% if '0' == contentAuditSetting.enable_auto_audit|default(1) %} checked="checked" {% endif %}>
          {{ 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.not_allow'|trans }}
        </label>
        {# todo:二期不支持先审后发,因此文案调整 #}
        {#<span class="text-muted text-sm js-auto-audit-mode-tips">
          {% set tip = 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.'~contentAuditSetting.mode|default('audit_after')~'.not_allow.tips' %}
          {{ tip|trans }}
        </span>#}
        <span class="text-muted text-sm">
          {% set tip = 'admin_v2.system.user_content_control.content_audit_setting.auto_audit.audit_before.not_allow.tips' %}
          {{ tip|trans }}
        </span>
      </div>
    </div>
    <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
    <div class="form-group">
      <div class="col-md-offset-3 col-md-8">
        <a class="btn btn-primary mtl pll prl js-save-btn"
           data-loading-text="{{ 'form.btn.save.submiting'|trans }}">{{ 'form.btn.submit'|trans }}</a>
      </div>
    </div>
  </form>
{% endblock %}
